home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 6.7 KB | 216 lines | [TEXT/MPS ] |
- {
- File: Navigation.p
-
- Contains: Navigation Services Interfaces
-
- Version: Technology: System 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- }
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT Navigation;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __NAVIGATION__}
- {$SETC __NAVIGATION__ := 1}
-
- {$I+}
- {$SETC NavigationIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED __TYPES__}
- {$I Types.p}
- {$ENDC}
- {$IFC UNDEFINED __APPLEEVENTS__}
- {$I AppleEvents.p}
- {$ENDC}
- {$IFC UNDEFINED __FILES__}
- {$I Files.p}
- {$ENDC}
- {$IFC UNDEFINED __EVENTS__}
- {$I Events.p}
- {$ENDC}
- {$IFC UNDEFINED __MIXEDMODE__}
- {$I MixedMode.p}
- {$ENDC}
- {$IFC UNDEFINED __SCRIPT__}
- {$I Script.p}
- {$ENDC}
- {$IFC UNDEFINED __TEXTOBJECTS__}
- {$I TextObjects.p}
- {$ENDC}
- {$IFC UNDEFINED __TIMEOBJECTS__}
- {$I TimeObjects.p}
- {$ENDC}
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- {$IFC FOR_SYSTEM8_COOPERATIVE }
- {$IFC FOR_PTR_BASED_AE }
-
- CONST
- gestaltNavigationServicesAttr = 'nvsv';
- gestaltNavigationServicesPresent = 0;
-
- { Values for the "action" parameter of NavAskSaveChanges }
- kNavSaveChangesClosingDocument = 1; { Closing a document }
- kNavSaveChangesQuittingApplication = 2; { Quitting the app }
- kNavSaveChangesOther = 0; { Neither closing nor quitting }
-
-
- TYPE
- NavAskSaveChangesAction = UInt16;
- { NavFileInfo is the part of NavFileOrFolderInfo for files }
- NavFileInfoPtr = ^NavFileInfo;
- NavFileInfo = RECORD
- locked: BOOLEAN;
- resourceOpen: BOOLEAN;
- dataOpen: BOOLEAN;
- reserved: BOOLEAN;
- dataSize: LONGINT;
- resourceSize: LONGINT;
- finderInfo: FInfo;
- moreFinderInfo: FXInfo;
- END;
-
- { NavFolderInfo is the part of NavFileOrFolderInfo for folders and volumes }
- NavFolderInfoPtr = ^NavFolderInfo;
- NavFolderInfo = RECORD
- shareable: BOOLEAN;
- sharePoint: BOOLEAN;
- mounted: BOOLEAN;
- readable: BOOLEAN;
- writeable: BOOLEAN;
- reserved: BOOLEAN;
- numberOfFiles: LONGINT;
- finderInfo: DInfo;
- moreFinderInfo: DXInfo;
- END;
-
- { NavFileOrFolderInfo is the structure passed to your filter proc for typeFSS AEDescs }
- NavFileOrFolderInfoPtr = ^NavFileOrFolderInfo;
- NavFileOrFolderInfo = RECORD
- isFolder: BOOLEAN;
- visible: BOOLEAN;
- creationDate: TimeObject;
- modificationDate: TimeObject;
- CASE INTEGER OF
- 0: (
- fileInfo: NavFileInfo;
- );
- 1: (
- folderInfo: NavFolderInfo;
- );
- END;
-
- NavEventProcPtr = ProcPtr; { FUNCTION NavEvent((CONST)VAR event: EventRecord; contextPtr: UNIV Ptr): BOOLEAN; }
-
- NavObjectFilterProcPtr = ProcPtr; { FUNCTION NavObjectFilter(VAR theItem: AEDesc; info: UNIV Ptr; contextPtr: UNIV Ptr): BOOLEAN; }
-
- NavEventUPP = UniversalProcPtr;
- NavObjectFilterUPP = UniversalProcPtr;
- NavDialogOptionsPtr = ^NavDialogOptions;
- NavDialogOptions = RECORD
- location: Point; { Top-left of the dialog, or (-1, -1) for default position }
- banner: TextObject; { Optional banner text displayed in the dialog }
- defaultButtonLabel: TextObject; { Label of the default button (or null string for default) }
- customPanel: Ptr; { Custom SOM panel to be inserted, if any }
- END;
-
- NavReplyRecordPtr = ^NavReplyRecord;
- NavReplyRecord = RECORD
- validRecord: BOOLEAN; { True if the user confirmed the selection, false on cancel }
- replacing: BOOLEAN; { True if we are overwriting an existing object (put only) }
- selection: AEDesc; { AppleEvent descriptor of the selected object }
- END;
-
- { return values from NavAskSaveChanges, NavCustomAskSaveChanges }
-
- CONST
- askSaveChangesSave = 1;
- askSaveChangesCancel = 2;
- askSaveChangesDontSave = 3;
-
-
- TYPE
- NavAskSaveChangesResult = UInt16;
- {
- To specify which types of data you are willing to receive, use the NavTypeList.
- *
- * This is not a list of file types; that must be specified in an 'open' resource
- * if you are displaying files, or you can use a filter procedure. It is a list of
- * AEDesc types. Only items which can be coerced to these descriptor types will be
- * displayed in the list, descended into as containers, or returned in a reply.
- * The list is terminated by a null entry and may be of any length. At present
- * only typeFSS and typeAlias are supported.
- *
- * If you include typeAlias in the list, then aliases of all types will be allowed,
- * and aliases will not be resolved before they are given to you. Otherwise, aliases
- * will be resolved internally and you will be passed their resolved AEDescs if
- * they can be coerced into one of the types you want.
- }
- NavTypeList = ARRAY [0..3] OF DescType;
- ConstNavTypeListPtr = ^DescType;
- {
- * Navigation Services Dialogs
- }
- FUNCTION NavAskSaveChanges(applicationName: ConstTextObject; documentName: ConstTextObject; action: NavAskSaveChangesAction; VAR reply: NavAskSaveChangesResult; location: Point; eventProc: NavEventUPP; contextPtr: UNIV Ptr): OSErr;
- FUNCTION NavCustomAskSaveChanges(message: ConstTextObject; VAR reply: NavAskSaveChangesResult; location: Point; eventProc: NavEventUPP; contextPtr: UNIV Ptr): OSErr;
- FUNCTION NavGetObject({CONST}VAR defaultObject: AEDesc; VAR reply: NavReplyRecord; VAR dialogOptions: NavDialogOptions; openResourceID: INTEGER; typeList: ConstNavTypeListPtr; filterProc: NavObjectFilterUPP; eventProc: NavEventUPP; contextPtr: UNIV Ptr): OSErr;
- FUNCTION NavPutObject({CONST}VAR defaultObject: AEDesc; VAR reply: NavReplyRecord; VAR dialogOptions: NavDialogOptions; eventProc: NavEventUPP; contextPtr: UNIV Ptr): OSErr;
- {
- * Generating unique file names
- }
- FUNCTION MakeUniqueNameInFolder(VAR folder: FSSpec; VAR name: TextObject): OSErr; C;
-
- CONST
- uppNavEventProcInfo = $000003D0;
- uppNavObjectFilterProcInfo = $00000FD0;
-
- FUNCTION NewNavEventProc(userRoutine: NavEventProcPtr): NavEventUPP;
- {$IFC NOT GENERATINGCFM }
- INLINE $2E9F;
- {$ENDC}
-
- FUNCTION NewNavObjectFilterProc(userRoutine: NavObjectFilterProcPtr): NavObjectFilterUPP;
- {$IFC NOT GENERATINGCFM }
- INLINE $2E9F;
- {$ENDC}
-
- FUNCTION CallNavEventProc({CONST}VAR event: EventRecord; contextPtr: UNIV Ptr; userRoutine: NavEventUPP): BOOLEAN;
- {$IFC NOT GENERATINGCFM}
- INLINE $205F, $4E90;
- {$ENDC}
-
- FUNCTION CallNavObjectFilterProc(VAR theItem: AEDesc; info: UNIV Ptr; contextPtr: UNIV Ptr; userRoutine: NavObjectFilterUPP): BOOLEAN;
- {$IFC NOT GENERATINGCFM}
- INLINE $205F, $4E90;
- {$ENDC}
- {$ENDC}
- {$ENDC}
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := NavigationIncludes}
-
- {$ENDC} {__NAVIGATION__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-